const Controller = require('egg').Controller;

class GoldController extends Controller{
    async addGold(){
        console.log('addGold');
        const { ctx } = this;
        
        const {account,gold} = ctx.request.body;
        const result = await ctx.service.gold.updateGold(account,gold);
        ctx.body = result;
    }

    async batchAddGold(){
        console.log('batchAddGold');
        const { ctx } = this;
        
        const {account,gold} = ctx.request.body;
        const result = await ctx.service.gold.batchUpdateGold(account,gold);
        ctx.body = result;
    }

    async batchCreaterUser(){
        console.log('batchAddGold');
        const { ctx } = this;
        const result = await ctx.service.gold.batchCreatedUser(ctx.request.body);
        ctx.body = result;
    }
}

module.exports = GoldController;